package cn.com.czpb.client.app;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.Window;

import cn.com.czpb.client.model.event.DayNightEvent;
import cn.com.czpb.client.utils.SPUtil;

import de.greenrobot.event.EventBus;
import de.greenrobot.event.Subscribe;


public class BaseActivity extends AppCompatActivity {
    protected Context mContext;

    protected SPUtil spu;//

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        mContext = this;
        spu=SPUtil.getInstance();
        EventBus.getDefault().register(this);


    }
    @Subscribe
    public void onEventMainThread(DayNightEvent event) {
        boolean mFlagNight = event.ismFlagSelectNight();
        spu.changeAppBrightness(this, spu.getIsNight());
    }
    @Override
    protected void onResume() {
        super.onResume();
        //夜间模式
//        ReadModeUtils.setNightOrDayMode(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
    }


}
